﻿package plugin.roleN
{
    import com.core.*;
    import com.sh.game.consts.*;
    import com.sh.game.global.*;
    import plugin.roleN.controller.*;
    import view.*;

    public class Role extends FlashUIBase
    {
        private var _ctrl:RoleCtrl;

        public function Role()
        {
            return;
        }// end function

        override protected function preLoaderInit() : void
        {
            super.preLoaderInit();
            appendLoader(Config.getUrl("assets/images/mornui/roleN.swf", ResourceType.NORMAL));
            appendLoader(Config.getUrl("assets/images/mornui/common.swf", ResourceType.NORMAL));
            appendLoader(Config.getUrl("assets/images/mornui/zhuansheng.swf", ResourceType.NORMAL));
            return;
        }// end function

        override protected function initGUI() : void
        {
            super.initGUI();
            this._ctrl = new RoleCtrl(this);
            mGUI = this._ctrl;
            TitleBg = this._ctrl.titleBg;
            return;
        }// end function

        override protected function openRefresh() : void
        {
            super.openRefresh();
            this.uiControl.openRefresh(this.data);
            this.uiControl.zhuansheng.init();
            return;
        }// end function

        override protected function closeComplete() : void
        {
            super.closeComplete();
            this.uiControl.closeComplate();
            return;
        }// end function

        private function get uiControl() : RoleCtrl
        {
            return mGUI as RoleCtrl;
        }// end function

        override public function get width() : Number
        {
            var _loc_2:Array = null;
            var _loc_3:Array = null;
            var _loc_1:* = this._ctrl.curTab;
            switch(_loc_1)
            {
                case 1:
                {
                    return super.width;
                }
                case 2:
                {
                    return super.width;
                }
                case 3:
                {
                    return super.width + 285;
                }
                case 4:
                {
                    return super.width;
                }
                case 5:
                {
                    _loc_2 = ModelProxy.getValue("data", "fashion");
                    _loc_3 = ModelProxy.getValue("data", "huanwu");
                    if (_loc_2 && _loc_2.length > 0)
                    {
                        return super.width + 253;
                    }
                    if (_loc_3 && _loc_3.length > 0)
                    {
                        return super.width + 253;
                    }
                    return super.width;
                }
                default:
                {
                    break;
                }
            }
            return super.width;
        }// end function

    }
}
